Trading Time for Space in Prime Number Sieves
نویسنده
چکیده
A prime number sieve is an algorithm that nds the primes up to a bound n. We present four new prime number sieves. Each of these sieves gives new space complexity bounds for certain ranges of running times. In particular, we give a linear time sieve that uses only O(p n=(log log n) 2) bits of space, an O l (n= log log n) time sieve that uses O(n=((log n) l log log n)) bits of space, where l > 1 is constant, and two super-linear time sieves that use very little space.
منابع مشابه
A Space-eecient Fast Prime Number Sieve
We present a new algorithm that nds all primes up to n using at most O(n= log log n) arithmetic operations and O(n=(log n log log n)) space. This algorithm is an improvement of a linear prime number sieve due to Pritchard. Our new algorithm matches the running time of the best previous prime number sieve, but uses less space by a factor of (log n). In addition, we present the results of our imp...
متن کاملStudying the Monthly Effect on the Market Reactions Using Time-Space -Frequency Analysis (Case Study: Tehran Stock Exchange)
Anomaly is an incident or event that cannot be explained by the dominant theories. Anomalies are situated in confronting with the efficient market theory, so that it provides conditions for stock trading strategies with additional returns in case of existing predetermined returns. Therefore, in this study, the anomaly due to monthly effects on the stock volume trading and the Tehran Stock Excha...
متن کاملTwo Compact Incremental Prime Sieves
A prime sieve is an algorithm that finds the primes up to a bound n. We say that a prime sieve is incremental, if it can quickly determine if n+1 is prime after having found all primes up to n. We say a sieve is compact if it uses roughly √ n space or less. In this paper we present two new results: • We describe the rolling sieve, a practical, incremental prime sieve that takes O(n log logn) ti...
متن کاملThe Pseudosquares Prime Sieve
We present the pseudosquares prime sieve, which finds all primes up to n. Define p to be the smallest prime such that the pseudosquare Lp > n/(π(p)(logn)); here π(x) is the prime counting function. Our algorithm requires only O(π(p)n) arithmetic operations and O(π(p) log n) space. It uses the pseudosquares primality test of Lukes, Patterson, and Williams. Under the assumption of the Extended Ri...
متن کامل